import {defineStore} from 'pinia'
import {reactive} from "vue";

/**
 * 组合写法 - 仓库
 */
const useTalkStore1 = defineStore('talkStore1', () => {
    // 真正存取数据的地方
    const talkList = reactive(JSON.parse(sessionStorage.getItem('talkList') as string) || []);

    // actions
    const addTalk = (talk: any) => {
        talkList.push(talk);
    }
    return {talkList, addTalk}
});

export default useTalkStore1;
